<%--
    Document   : selectBill
    Created on : 01/11/2010, 12:12:43 AM
    Author     : Luke
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<jsp:useBean id="unpaidBills" class="java.util.Collection" scope="session"/>

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>SwinBank - Bill Payment</title>
    </head>
    <body>
        <h1>SwinBank - Bill Payment</h1>
        <hr />
        <form action="payBill" method="post">
            <p>Please select an outstanding bill to pay:
            </p>
            <table border="1">
                <tr>
                    <th></th>
                    <th>Biller Name</th>
                    <th>Biller Account ID</th>
                    <th>Amount Remaining ($)</th>
                    <th>Amount Paid ($)</th>
                </tr>
                <c:forEach var="bill" items="${unpaidBills}">
                    <tr>
                        <td><input type="radio" name="selectedBillId" value="${bill.getBillId()}"/></td>
                        <td><c:out value="${bill.getBillerName()}"/></td>
                        <td><c:out value="${bill.getBillerAccountId()}"/></td>
                        <td><c:out value="${bill.getAmount() - bill.getAmountPaid()}"/></td>
                        <td><c:out value="${bill.getAmountPaid()}"/></td>
                    </tr>
                </c:forEach>
            </table>
            <input type="submit" value="Pay Bill" />
        </form>
        <p><a href="main">Back to Main Menu</a></p>
    </body>
</html>